
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.murcanlat.webcan.util;

import com.murcanlat.webcan.exceptions.AnnotationException;
import java.lang.annotation.Annotation;

/**
 *
 * @author Murat CANPOLAT <murat.canpolat@gebze.bel.tr>
 */
public class Util {

    /**
     * Annotinoların birbirine eşitliği için kullanılacak
     *
     * @param classes
     * @param annotations
     * @return
     */
    public static Annotation annotationControl(Class classes, Annotation[] annotations)
            throws AnnotationException {
        for (Annotation annotation : annotations) {
            if (annotation.getClass().equals(classes)) {
                return annotation;
            }
        }
        throw new AnnotationException(classes.getName() + " Annotation not founds",
                "Kolonda Annotation bulunamadı Bilgi işlemle irtibata geçiniz");
    }

    public static boolean isNotEmpty(Object data) {
        return data != null;
    }
}
